You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that `CHANNEL_ACCOUNT_ENCRYPTION_PASSPHRASE` is required to be set to a non-empty value. For development purposes,
61
+
you can set it to any value. For production, you should set it to a secure passphrase. For `WALLET_SIGNING_KEY`, and
62
+
`DISTRIBUTION_ACCOUNT_PRIVATE_KEY` and `DISTRIBUTION_ACCOUNT_PUBLIC_KEY`, you can generate them using the Stellar CLI or by using tools like lab.stellar.org. Note that the `DISTRIBUTION_ACCOUNT_PUBLIC_KEY` is the public key of the account that will be used to sponsor accounts for channel accounts, and therefore must be a valid Stellar account.
63
+
84
64
3. Start the containers:
65
+
85
66
```bash
86
67
docker-compose up
87
68
```
@@ -96,74 +77,65 @@ we started earlier.
96
77
This second way of setting up is preferable for more active development where you would
97
78
like to add debug points to the code.
98
79
99
-
1. Start the `db` and `stellar-rpc` containers:
100
-
```bash
101
-
NETWORK=testnet docker-compose up -d db stellar-rpc
102
-
```
80
+
1. Create and run the `env.sh` script that exports each of the environment variables with the contents shared in the previous section. Note that some variables need to be added to the script to use localhost URLs instead of the URLs usable within the docker network.
103
81
104
-
2. Create a shell script `env.sh` and add the required environment variables:
3. Instead of spinning up `api` and `ingest` as docker services like we did earlier, we will run them locally.
144
95
145
96
1.**API**
146
-
1. Run migrations:
97
+
1. Source the `env.sh` file:
98
+
99
+
```bash
100
+
source env.sh
101
+
```
102
+
103
+
2. Run migrations:
104
+
147
105
```bash
148
106
go run main.go migrate up
149
107
```
150
108
151
-
2. Generate channel accounts
109
+
3. Generate channel accounts
110
+
152
111
```bash
153
112
go run main.go channel-account ensure 5
154
113
```
155
114
156
-
3. Start API server
115
+
4. Start API server
116
+
157
117
```bash
158
118
go run main.go serve
159
119
```
160
120
161
121
2. **Ingest**
162
-
1. In a separate terminal tab, run the ingestion service:
122
+
1. In a separate terminal tab, source the `env.sh` file and run the ingestion service:
123
+
163
124
```bash
125
+
source env.sh
164
126
go run main.go ingest
165
127
```
166
128
167
129
This allows us to establish a dev cycle where you can make changes to the code and restart the `api` and `ingest` services
168
130
to test them. Based on the IDE you are using, you can add the build configurations for these services, along with
169
-
the environment variables to add breakpoints to your code.
131
+
the environment variables to add breakpoints to your code.
132
+
133
+
### Testing
134
+
135
+
To run the tests, you can use the following command:
136
+
137
+
```bash
138
+
go test ./...
139
+
```
140
+
141
+
Note that you must set up your environment as defined in the previous section to run the tests, where the database and stellar-rpc are running in docker containers. Alternatively, you could run the database and stellar-rpc locally and run the tests without docker.
0 commit comments