Check our terms and conditions, privacy policies, and cookies policy.
Copyright 2024 © All rights Reserved. Designed by LACNet
We are assuming you already have a writer node deployed and permissioned in one of the LACChain Networks orchestrated by LACNet. If not, please see the steps to deploy a node and the networks available.
NOTE: If you deployed your node with docker or kubernetes, skip section "Run the Relaysigner Component" and go to section "Adapt your Smart Contract to our GAS Distribution Protocol".
Wait until your writer node has synced the entire blockchain. Then, check that you have the environment variable WRITER_KEY set on your node
$ env
In case you don’t have the WRITER_KEY variable in your environment, please set this variable with the content of the file /lacchain/data/key
$ export WRITER_KEY=PRIVATE_KEY //where PRIVATE_KEY is content of /lacchain/data/key
Enter the node’s console and run the following commands:
$ cd /root/lacchain/gas-relay-signer
$ systemctl import-environment WRITER_KEY
$ service relaysigner start
Verify relaysigner is working well, go to the log file.
$ cd /root/lacchain/gas-relay-signer/log
$ tail -100 idbServiceLog.log
The first lines should be something like this:
General Logger: 2021/11/23 16:19:19 main.go:60: smartContract=0x3B62E51E37d090453600395Ff1f9bdf4d7398404 AgentKey=/home/adrian/.ethereum/keystore/UTC--2020-06-26T19-00-23.241896464Z--bceda2ba9af65c18c7992849c312d1db77cf008e
General Logger: 2021/11/23 16:19:19 main.go:65: Init RelaySigner
General Logger: 2021/11/23 16:19:19 client.go:46: Connected to Ethereum Node: ws://localhost:4546
That means relaysigner is configured and working well.
Remeber to have sent your node address. If not, then please, run these commands on your node and copy your node address:
$ cd /root/lacchain/data
$ cat nodeAddress
Now send an email with the subject “permissioning account node” to [email protected] writing as content your node address and your the name of your organization.
When you receive the response, your node will be ready to send transactions or deploy contracts.
As the sender with which the transactions arrive at the receipient contract is the address of the RelayHub contract, a mechanism is necessary to obtain the original sender of the client or user who sent the transaction.
To make this possible, we take advantage of the atomicity of the execution of the transactions in the EVM. That is, every time a transaction is sent to the RelayHub, the address of the original sender is stored, which is then retrieved by making a call to the RelayHub from the recipient contract.
This function to obtain the original sender is located in an abstract contract, which has to be inherited by all the contracts that will be deployed in the network.
The abstract contract to inherit is BaseRelayRecipient. After inherit this contract you have to update the value of the internal variable trustedForwarder by one of following address.
On Open-protestnet = 0xa4B5eE2906090ce2cDbf5dfff944db26f397037D
On Mainnet = 0xEAA5420AF59305c5ecacCB38fcDe70198001d147
Next, you should use _msgSender() function instead msg.sender.
(image below show you as use _msgSender() instead msg.sender)
Finally compile your contract.
Additionally, you can find and example in Storage2.sol
On Open-protestnet = 0xB9e9C5C528C266f2A1C7Eeec1975595232C8E475
On Mainnet = 0x34B220Ef63dea567eDf6d540316B5a3f4831Cf6c
0: Block GAS limit exceeded
1: The person who sent the transaction is not the same person who signed it.
2: The nonce is not correct.
3: The GAS limit sent is higher than the amount of GAS the node has.
4: The destination contract has no code, that is, the destination address is empty.
5: Trying to deploy a contract with 0 bytes.
6: The transaction is not well signed.
7: The destination of the transaction is a network management contract.
Some frequent errors after send a transaction are the following:
--permissions-accounts-contract-enabled=true
On mainnet, the nodes have a membership, so the deployment of contracts is limited to the GAS limit assigned to the node. In case of an organization requires a larger quantity to deploy its contract, please send an email to [email protected] indicating that it is required one or two days with the amount of GAS to deploy the contract.
Check our terms and conditions, privacy policies, and cookies policy.
Copyright 2024 © All rights Reserved. Designed by LACNet