or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
(Generic) Swap Test Guide
Instructions
1. Start the client of your choice
This guide should work with any ethereum client provided that it has accounts and has its first account prefunded and unlocked. For specific clients there are some instructions below.
2. Run the deploy script
You can download and pipe directly into bash using:
Alternatively download first, then run with
bash
:Notes:
jq
andcurl
to be installedbash
, and not necessarily othersh
implementationsIf the rpc port of the ethereum backend is not 8545 you can specify it manually using the
BACKEND
environment variable. (e.g.BACKEND=http://localhost:4444 bash deploy.sh
forrskj
). If you use different bzzaccounts than in the guide you can specify the prefunded accounts using theBZZACCOUNTS
variable.If you want to read the deployment script, follow this link.
This guide uses the
SWARM_SWAP_BACKEND_URL
andSWARM_SWAP_CHEQUEBOOK_FACTORY_ADDR
environment variables to set the backend and factory. This allows using the sameswarm
commands regardless of which client is used. The necessary export commands are printed as the result of the script and stored in a file calledtest-env
usingtee
. This file is then sourced prior to executingswarm
.3. Run the swarm nodes
This will populate the datadirs of the swarm nodes with the accounts already prefunded both with ether and tokens. It will also use predefined nodekeys. If you want to reset balances to 0 simply execute the entire code again. If you want the datadir to persist only execute the last line (in that case make sure
DATADIR1
and/orDATADIR2
is defined).Start the first node (with syncing disabled) with
and the second node with this:
4. Generate a random file and upload
This continously generates files and pushes them to one node and then retrieves them one the other one.
6. Query Balances
Query all balances:
Query a specific balance:
Client Specific Instructions
Ganache
ganache does not need any specific flags
Geth
geth in dev mode starts with its first account unlocked. rpc needs to be enabled by flag.
Parity
parity in dev mode does not unlock its prefunded account by default. The password is the empty string (that is what the
<(echo)
is for).This starts with a premined address (
0x00a329c0648769a73afac7f9381e08fb43dbea72
).rskj
Download the rskj node with the event data field fix from here. If you don't want to login to google you can also download it from swarm here.
This starts with a premined address (
0xcd2a3d9f938e13cd947ec05abc7fe734df8dd826
).Note:
rskj
has its rpc on port 4444 by default. SpecifyBACKEND=http://localhost:4444
.Observed issues with specific clients
suggest gas price issues with rskj
Under the hood suggest gas price uses
eth_gasPrice
for rpc connections. This call works on rksj as verified withcurl
:It is unknown if this is problem with swap or rsk. Most likely the problem is not in swap but lower in the http stack. Connecting through a
mitmproxy
mitigates this. This and the fact that swap works with all other clients indicates that the issue might be with rskj (However capturing and manually resending the requests using curl leads to rskj responding correctly).