Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Introduce neon_proxy_version handler
  • Loading branch information
vasiliy-zaznobin committed Nov 23, 2021
commit 32d1cfc9e3e9cd623ff679f464693c641d9694f6
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ COPY --from=spl /opt/solana_utils.py \
/spl/bin/
COPY --from=spl /opt/neon-cli /spl/bin/emulator

RUN export NEON_PROXY_REVISION_TO_BE_REPLACED=$(git rev-parse HEAD)
RUN echo ${NEON_PROXY_REVISION_TO_BE_REPLACED}
RUN sed -i 's/NEON_PROXY_REVISION_TO_BE_REPLACED/'"${NEON_PROXY_REVISION_TO_BE_REPLACED}"'/g' ./plugin/solana_rest_api.py
COPY . /opt
COPY proxy/operator-keypair.json /root/.config/solana/id.json
RUN cd /usr/local/lib/python3.8/dist-packages/ && patch -p0 </opt/solana-py.patch
Expand Down
6 changes: 6 additions & 0 deletions proxy/plugin/solana_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
modelInstance = None

EXTRA_GAS = int(os.environ.get("EXTRA_GAS", "0"))
NEON_PROXY_PKG_VERSION = '0.4.1-rc0'
NEON_PROXY_REVISION = 'NEON_PROXY_REVISION_TO_BE_REPLACED'

class EthereumModel:
def __init__(self):
Expand Down Expand Up @@ -86,6 +88,10 @@ def get_solana_account() -> Optional[sol_Account]:
solana_account = sol_Account(values)
return solana_account

def neon_proxy_version(self):
neon_config_load(self)
return 'Neon-proxy/v' + NEON_PROXY_PKG_VERSION + '-' + NEON_PROXY_REVISION

def web3_clientVersion(self):
neon_config_load(self)
return self.neon_config_dict['web3_clientVersion']
Expand Down